Page({
            data: {
                prizeList: ['一等奖', '二等奖', '三等奖', '鼓励奖'], //奖品列表
                result: '', //中奖结果
                isStart: false //是否正在抽奖
            },
            startLottery: function () {
                    if (this.data.isStart) {
                        return
                    }
                    this.setData({
                        isStart: true,
                    })
                    let curIndex = 0
                    let maxIndex = this.data.prizeList.length - 1
                    let timer = setInterval(() => {
                        curIndex = curIndex == maxIndex ? 0 : curIndex + 1
                        this.setData({
                            result: this.data.prizelist[curIndex],
                        })
                    }, 50)
                    setTimeout(() => {
                        clearInterval(timer)
                        this.setData({
                            isStart: false,
                        })
                        wx.showModal({
                            title: '中奖结果!',
                            content: this.data.result,
                            showCancel: false,
                        })
                    }, 3000)
                }
            }
        )